<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Fetch one result row into array</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.odbc-fetch-array.html">odbc_fetch_array</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.odbc-fetch-object.html">odbc_fetch_object</a></div>
 <div class="up"><a href="ref.uodbc.html">ODBC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.odbc-fetch-into" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_fetch_into</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">odbc_fetch_into</span> &mdash; <span class="dc-title">Fetch one result row into array</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.odbc-fetch-into-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>odbc_fetch_into</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span>
   , <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$result_array</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$rownumber</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Fetch one result row into <span class="type"><a href="language.types.array.html" class="type array">array</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.odbc-fetch-into-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">result_id</code></em></dt>

     <dd>

      <p class="para">
       The result <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span>.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">result_array</code></em></dt>

     <dd>

      <p class="para">
       The result <span class="type"><a href="language.types.array.html" class="type array">array</a></span>
       that can be of any type since it will be converted to type
       array. The array will contain the column values starting at array
       index 0.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">rownumber</code></em></dt>

     <dd>

      <p class="para">
       The row number.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.odbc-fetch-into-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of columns in the result;
   <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.odbc-fetch-into-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.2.0</td>
       <td>
        The <em><code class="parameter">result_array</code></em> and <em><code class="parameter">rownumber</code></em>
        parameters have been swapped. This allows the rownumber to be a constant again. 
       </td>
      </tr>

      <tr>
       <td>4.0.6</td>
       <td>
        The <em><code class="parameter">rownumber</code></em> can no longer be passed in as a
        constant, but rather as a variable. This again changed in 4.2.0.
       </td>
      </tr>

      <tr>
       <td>4.0.5</td>
       <td>
        The <em><code class="parameter">result_array</code></em> parameter no longer needs to
        be passed in by reference.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.odbc-fetch-into-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-867">
    <p><strong>Example #1 <span class="function"><strong>odbc_fetch_into()</strong></span> examples</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$rc&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_into</span><span style="color: #007700">(</span><span style="color: #0000BB">$res_id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$my_array</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>
     or
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$rc&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">odbc_fetch_into</span><span style="color: #007700">(</span><span style="color: #0000BB">$res_id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$my_array</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.odbc-fetch-array.html">odbc_fetch_array</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.odbc-fetch-object.html">odbc_fetch_object</a></div>
 <div class="up"><a href="ref.uodbc.html">ODBC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
